<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Category extends Model {
  public $timestamps = false;

  public $fillable = [ 'name', 'alias', 'template_name' ];

  public function parent() {
    return $this->belongsTo( 'App\Models\Category' );
  }

  public function children() {
    return $this->hasMany( 'App\Models\Category', "parent_id" );
  }

}
